var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var ResKeeper = require("AA_ResKeeper");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_GongGaoItem = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.content = null;
    t.titel = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onEnable = function () {};
  _creator.prototype.initUi = function (e) {
    var t = this;
    this.titel.string = "更新公告";
    var o = e.content;
    var n = this.content.children;
    var i = Math.max(o.length, n.length);
    for (var a = 0; a < i; a++) {
      var r = n[a];
      var c = o[a];
      if (c) {
        if (!r) {
          r = cc.instantiate(n[0]);
          this.content.addChild(r);
        }
        r.getComponent(cc.Label).string = c;
      } else {
        r && (r.active = false);
      }
    }
    this.scheduleOnce(function () {
      t.updateHeight(t.content.height);
    }, 0);
  };
  _creator.prototype.getServerTime = function (e) {
    return new Date(e);
  };
  _creator.prototype.updateHeight = function (e) {
    var t = this;
    this.scheduleOnce(function () {
      t.node.height = e + 107;
    });
  };
  _creator.prototype.onClickShou = function (e) {
    var t = e.getCurrentTarget();
    if (t.children[0].active) {
      t.children[0].active = false;
      t.children[1].active = true;
      this.content.scaleY = 0;
      this.updateHeight(0);
    } else {
      t.children[0].active = true;
      t.children[1].active = false;
      cc.tween(this.content).to(.2, {
        scaleY: 1
      }).start();
      this.updateHeight(this.content.height);
    }
  };
  _creator.prototype.onDisable = function () {};
  __decorate([_property(cc.Node)], _creator.prototype, "content", undefined);
  __decorate([_property(cc.Label)], _creator.prototype, "titel", undefined);
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_GongGaoItem;